import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';

export default async function a004(fd: IFeidaoAiBrowserComponent) {// 依据表格进行全选和反选
	// todo
	console.log('zj-000003:a004----start');
	const nodes = fd.data.node.querySelectorAll('[data-id="list"]');
	const nodes_chk = fd.data.node.querySelectorAll('[data-id="list"]:checked');/*伪数组 */
	const node = fd.data.node.querySelector<HTMLInputElement>('[data-id="all"]');

	if (Array.from(nodes).length === Array.from(nodes_chk).length) {
		node.checked = true;
	} else {
		node.checked = false;
	}
	console.log('zj-000003:a004----end');
}
